package com.i2works.smartluolong.api.utils;


import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 授权认证拦截器
 *
 * @author koal <koal@vip.qq.com>
 * @date 2017/10/17 16:33
 */

public class SessionAuthInterceptor extends HandlerInterceptorAdapter {

    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        System.err.println("授权认证拦截器.............");
//        System.err.println("RequestURL==>"+request.getRequestURL().toString());
//        System.err.println("HeaderNames==>"+request.getHeaderNames().nextElement().toUpperCase());
        return super.preHandle(request, response, handler);
    }

    @Override
    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {
        System.err.println("授权通过后执行.............");
        super.postHandle(request, response, handler, modelAndView);
    }
}
